package ctp.ykit.com.yctp;

import com.sfit.ctp.thostmduserapi.CThostFtdcDepthMarketDataField;
import com.sfit.ctp.thostmduserapi.CThostFtdcForQuoteRspField;
import com.sfit.ctp.thostmduserapi.CThostFtdcMdSpi;
import com.sfit.ctp.thostmduserapi.CThostFtdcRspInfoField;
import com.sfit.ctp.thostmduserapi.CThostFtdcRspUserLoginField;
import com.sfit.ctp.thostmduserapi.CThostFtdcSpecificInstrumentField;
import com.sfit.ctp.thostmduserapi.CThostFtdcUserLogoutField;

/**
 * Created by think on 2016-06-17.
 */
public class CQuote extends CThostFtdcMdSpi {

    public IQuoteEvent pQuoteEvent;

    public void SetInterFace(IQuoteEvent i)
    {
        pQuoteEvent = i;
    }

    public void OnFrontConnected() {
        pQuoteEvent.OnFrontConnected();
    }

    public void OnFrontDisconnected(int nReason) {
        pQuoteEvent.OnFrontDisconnected(nReason);
    }

    public void OnHeartBeatWarning(int nTimeLapse) {
        pQuoteEvent.OnHeartBeatWarning(nTimeLapse);
    }

    public void OnRspUserLogin(CThostFtdcRspUserLoginField pRspUserLogin, CThostFtdcRspInfoField pRspInfo, int nRequestID, boolean bIsLast) {
        pQuoteEvent.OnRspUserLogin(pRspUserLogin,pRspInfo,nRequestID,bIsLast);
    }

    public void OnRspUserLogout(CThostFtdcUserLogoutField pUserLogout, CThostFtdcRspInfoField pRspInfo, int nRequestID, boolean bIsLast) {
         pQuoteEvent.OnRspUserLogout(pUserLogout,pRspInfo,nRequestID,bIsLast);
    }

    public void OnRspError(CThostFtdcRspInfoField pRspInfo, int nRequestID, boolean bIsLast) {
        pQuoteEvent.OnRspError(pRspInfo,nRequestID,bIsLast);
    }

    public void OnRspSubMarketData(CThostFtdcSpecificInstrumentField pSpecificInstrument, CThostFtdcRspInfoField pRspInfo, int nRequestID, boolean bIsLast) {
        pQuoteEvent.OnRspSubMarketData(pSpecificInstrument,pRspInfo,nRequestID,bIsLast);
    }

    public void OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField pSpecificInstrument, CThostFtdcRspInfoField pRspInfo, int nRequestID, boolean bIsLast) {
        pQuoteEvent.OnRspUnSubMarketData(pSpecificInstrument,pRspInfo,nRequestID,bIsLast);
    }

    public void OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField pSpecificInstrument, CThostFtdcRspInfoField pRspInfo, int nRequestID, boolean bIsLast) {
        pQuoteEvent.OnRspSubForQuoteRsp(pSpecificInstrument,pRspInfo,nRequestID,bIsLast);
    }

    public void OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField pSpecificInstrument, CThostFtdcRspInfoField pRspInfo, int nRequestID, boolean bIsLast) {
        pQuoteEvent.OnRspUnSubForQuoteRsp(pSpecificInstrument,pRspInfo,nRequestID,bIsLast);
    }

    public void OnRtnDepthMarketData(CThostFtdcDepthMarketDataField pDepthMarketData) {
        pQuoteEvent.OnRtnDepthMarketData(pDepthMarketData);
    }

    public void OnRtnForQuoteRsp(CThostFtdcForQuoteRspField pForQuoteRsp) {
        pQuoteEvent.OnRtnForQuoteRsp(pForQuoteRsp);
    }
}
